package test.反射;

import entity.Student;

/**
 * Created by chengxiaoqi1 on 2018/5/17.
 */
public class ReflectionDemo {
    public static void main(String[] args) {
        Student student = new Student();
        Class stuClazz1  = student.getClass();
        System.out.println(stuClazz1.getName());

        Class stuClazz2 = Student.class;
        System.out.println(stuClazz1 == stuClazz2); // true

        try {
            Class stuClazz3 = Class.forName("entity.Student");
            System.out.println(stuClazz3 == stuClazz2);
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
    }
}
